<template>
  <t-image-viewer v-if="!store.isMobileType" v-model:visible="ImgVisible" :images="[urls + props.info.value]">
  </t-image-viewer>
  <van-image-preview :show-index="false" v-else v-model:show="ImgVisible" :images="[urls + props.info.value]">
  </van-image-preview>
  <div class="outline-parent jy-style-height border-hover-style">
    <div
      class="content outline-parent-bg"
      :style="{
        backgroundImage: `url(${publicUrls + 'free/style5/Level1outlineStyle3Bg.webp'})`,
      }"
    >
      <div class="Showroom-parent" v-if="props.info.digitalShowroom">
        <digitalShowroomIcon :url="props.info.digitalShowroom" :id="props.info.id" />
      </div>
      <div class="title-box" :class="{ 'title-box-2': !props.info.subTitle && !props.info.remarks }">
        <p>{{ props.info.text }}</p>
      </div>
      <div class="right-box" :class="{ 'right-box-3': !props.info.subTitle && !props.info.value }">
        <p class="subtitle" v-if="props.info.subTitle">——{{ props.info.subTitle }}</p>

        <div
          class="img-box"
          :class="{
            'img-box1': props.info.remarks,
            'img-box2': !props.info.remarks,
            'img-box3': !props.info.remarks && !props.info.subTitle,
          }"
          :style="{
            backgroundImage: `url(${
              publicUrls +
              (props.info.remarks
                ? 'free/style5/Level1outlineStyle3Bgimg1.webp'
                : 'free/style5/Level1outlineStyle3Bgimg2.webp')
            })`,
          }"
          v-if="props.info.value"
        >
          <div  class="outline-cover">
            <img
           
            @click="ImgVisible = true"
            :src="urls + props.info.value + '?imageView2/3/format/webp'"
            alt=""
          />
          </div>
        </div>
        <div class="remarks1" v-if="props.info.value">
          <TextMax
            :infoData="props.info"
            v-if="props.domShow"
            :data="props.info.remarks"
            :title="props.info.text"
            :row="getRemarksNum(9, route.meta.loopType)"
          ></TextMax>
        </div>
        <div class="remarks2" v-else-if="props.info.remarks">
          <TextMax
            :infoData="props.info"
            v-if="props.domShow"
            :data="props.info.remarks"
            :title="props.info.text"
            :row="getRemarksNum(21, route.meta.loopType)"
          ></TextMax>
        </div>
      </div>
    </div>
  </div>
</template>  

<script lang="ts">
export default defineComponent({
  name: 'free3Style1',
});
</script> 
  
<script setup lang="ts">
import { getRemarksNum } from '@/utils/minxin';
import digitalShowroomIcon from '@/freeComponents/unitdigitalShowroom/style5.vue';
import { publicUrls } from '@/utils/minxin';
import { getTextHtml, textType } from '@/utils/minxin';
import { urls } from '@/utils/request/upload';
import { computed, defineComponent, ref } from 'vue';
import TextMax from '@/freeComponents/textMode/TextMax5.vue';
import { useProjectStore } from '@/store';
import { useRouter, useRoute } from 'vue-router';
const route = useRoute();
const ImgVisible = ref(false);
const store = useProjectStore();
const title = ref();

const props = defineProps({
  info: {
    type: Object,
  },
  domShow: {
    type: Boolean,
  },
});

// 跳转全景链接
const open = (url: any) => {
  if (url) {
    window.open(url, '_blank');
  }
};
</script>

<style scoped lang="less">
.outline-parent {
  position: relative;
  margin-right: 200px;
  // margin-left: 120px;
  margin-top: 0;
}
.content {
  display: flex;
  // flex-direction: column;
  width: 570px;
  height: 100%;
  background-size: 100% 100%;
  background-repeat: no-repeat;
  // box-shadow: 8px 6px 4px 0px rgba(2, 2, 2, 0.1);
  padding: 66px 27px 0;
  padding-right: 101px;
}
.Showroom-parent {
  display: flex;
  position: absolute;
  top: 10px;
  right: 96px;
  z-index: 15;
  width: 50px;
  height: 50px;
}
.title-box {
  display: flex;
  align-items: center; 
  justify-content: center;
  width: 36px;
  height: 768px;

  :deep(p) {
    width: 36px;
    font-family: SourceBold;
    font-size: 32px;
    color: rgba(232, 231, 229, 1);
    line-height: 44px; //48px
    text-align: center;
  }
}

.right-box {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 337px;
  margin-left: 69px;
  height: 783px;
  padding: 3px 0;
}
.subtitle {
  width: 100%;
  font-family: SourceMedium;
  font-size: 18px;
  color: rgba(63, 95, 92, 1);
  line-height: 28px;
  text-align: center;
  font-weight: 400;
}

.img-box {
  margin-top: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  background: rgba(219, 218, 216, 1);
  background-size: 100% 100%;
  background-repeat: no-repeat;
  // border-radius: 8px; 
  .outline-cover {
    overflow: hidden;
    background: rgba(231, 230, 229, 1);
    object-fit: contain;
    img{
      transition: all .3s;
      width: 100%;
      height: 100%;
       object-fit: contain;
    }
  }
}
.img-box:hover{
  .outline-cover{
    img{
      transform: scale(1.3);
    }
    
  }
}
.img-box1 {
  width: 337px;
  height: 346px;
  margin-top: 17px;
  .outline-cover {
    width: 267px;
    height: 283px;
  }
}
.img-box2 {
  width: 337px;
  height: 441px;
  margin-top: 20px;
  .outline-cover {
    background: rgba(231, 230, 229, 1);

    width: 267px;
    height: 378px;
  }
}
.img-box3 {
  margin-top: 0; 
}
// .outline-cover {
//   height: 180px;
//   width: auto; 
//   max-width: 320px;
//   object-fit: contain;
//   transition: all 0.3s;
// }
.outline-cover:hover { 
  // transform: scale(1.2); 
}
  
.remarks1 {
  width: 100%;
  margin-top: 23px;
}
.remarks2 {
  width: 100%;
  margin-top: 20px;
}
.right-box-3{ 
  .remarks2{
    margin-top: -15px !important;
  }
}
</style>
